#!/bin/sh

filePath=$(cd $(dirname $0);pwd -P)
projPath=$filePath/..
buildDir="CMake_Build"


make_all(){


    mkdir -p $buildDir
    cd $buildDir
    cmake  ..
    make   -j12
    
    cd ..
}





make_clean(){
    # 清除编译产生的中间文件
    rm -rf $buildDir
}

run_exe(){
    ./$buildDir/demo
}



main () {
    case ${1} in
        "-all")
            echo ${1}
            make_all
            # run_exe

            ;;
        "-clean")     
            echo ${1}
            make_clean
            ;;
        
        *)
            echo "####################### MENU #######################"
            echo "$0                    MENU"
            echo "$0 -all               编译全部"
            echo "$0 -clean             删除编译生成的文件"
            echo ""
            echo "###################################################"

            ;;
    esac

}

main $1